<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 */
get_header();
?>

<div id="main_body">
<?php get_sidebar(); ?> 
    <div class="main_content">
        <div id="container"> 
            <ul class="tabs"> 
                <li class="active" rel="tab1"> Tin tức</li>
                <li rel="tab2"> Sự kiện</li>
                <li rel="tab3"> Diễn đàn</li>
                <li rel="tab4"> Hỗ trợ</li>
            </ul> 
            <div class="tab_container"> 

                <div id="tab1" class="tab_content"> 

                    <p>  
                        <?php
                        if ($title)
                            echo $beforetitle . $title . $aftertitle;
                        $pq = new WP_Query(array('post_type' => $ptype, 'showposts' => $pshow));
                        if ($pq->have_posts()) :
                            ?> 
                        <ul class="list_top_nav"> 
                        <?php
                        global $post;
                        $tmp_post = $post;
                        $args = array( 'posts_per_page' => 5, 'offset'=> 1, 'category' => get_option('link_tab1') );
                        $myposts = get_posts( $args );
                        foreach( $myposts as $post ) : setup_postdata($post); ?>
                                <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
                        <?php endforeach; ?>
                        <?php $post = $tmp_post; ?>
                        </ul>
                        <?php endif; ?>
                    </p>

                </div><!-- #tab1 -->
                <div id="tab2" class="tab_content">  
                     <p>  
                        <?php
                        if ($title)
                            echo $beforetitle . $title . $aftertitle;
                        $pq = new WP_Query(array('post_type' => $ptype, 'showposts' => $pshow));
                        if ($pq->have_posts()) :
                            ?> 
                        <ul class="list_top_nav"> 
                        <?php
                        global $post;
                        $tmp_post = $post;
                        $args = array( 'posts_per_page' => 5, 'offset'=> 1, 'category' => get_option('link_tab2') );
                        $myposts = get_posts( $args );
                        foreach( $myposts as $post ) : setup_postdata($post); ?>
                                <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
                        <?php endforeach; ?>
                        <?php $post = $tmp_post; ?>
                        </ul>
                        <?php endif; ?>
                    </p>

                </div><!-- #tab2 -->
                <div id="tab3" class="tab_content"> 

                     <p>  
                        <?php
                        if ($title)
                            echo $beforetitle . $title . $aftertitle;
                        $pq = new WP_Query(array('post_type' => $ptype, 'showposts' => $pshow));
                        if ($pq->have_posts()) :
                            ?> 
                        <ul class="list_top_nav"> 
                        <?php
                        global $post;
                        $tmp_post = $post;
                        $args = array( 'posts_per_page' => 5, 'offset'=> 1, 'category' => get_option('link_tab3') );
                        $myposts = get_posts( $args );
                        foreach( $myposts as $post ) : setup_postdata($post); ?>
                                <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
                        <?php endforeach; ?>
                        <?php $post = $tmp_post; ?>
                        </ul>
                        <?php endif; ?>
                    </p>

                </div><!-- #tab3 -->
                <div id="tab4" class="tab_content"> 

                    <p>  
                        <?php
                        if ($title)
                            echo $beforetitle . $title . $aftertitle;
                        $pq = new WP_Query(array('post_type' => $ptype, 'showposts' => $pshow));
                        if ($pq->have_posts()) :
                            ?> 
                        <ul class="list_top_nav"> 
                        <?php
                        global $post;
                        $tmp_post = $post;
                        $args = array( 'posts_per_page' => 5, 'offset'=> 1, 'category' => get_option('link_tab4') );
                        $myposts = get_posts( $args );
                        foreach( $myposts as $post ) : setup_postdata($post); ?>
                                <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
                        <?php endforeach; ?>
                        <?php $post = $tmp_post; ?>
                        </ul>
                        <?php endif; ?>
                    </p>

                </div><!-- #tab4 --> 

            </div> <!-- .tab_container --> 

        </div> <!-- #container -->
        <div class="clear"></div>
        <div class="slide_panel">
            <img class="image_slide"  src="<?php echo get_template_directory_uri(); ?>/images/cate_1.png" alt="cate1"/>
            <img class="image_slide"  src="<?php echo get_template_directory_uri(); ?>/images/cate_2.png" alt="cate2"/>
            <img class="image_slide"  src="<?php echo get_template_directory_uri(); ?>/images/cate_3.png" alt="cate3"/>
        </div>
        <div class="clear"></div>

        <div id="container_2"> 
            <ul class="tabs_2"> 
                <li class="active" rel="tab_1"> Tin tức</li>
                <li rel="tab_2"> Sự kiện</li>
                <li rel="tab_3"> Diễn đàn</li>
                <li rel="tab_4"> Hỗ trợ</li>
            </ul> 
            <div class="tab_container_2"> 

                <div id="tab_1" class="tab_content_2"> 

                        <?php if (have_posts()) : ?>
                        <div class="content_">
                            <?php while (have_posts()) : the_post(); ?>

                            <?php get_template_part('content', get_post_format()); ?>

    <?php endwhile; ?>
                        </div>
<?php else : ?>
                        <div class="content_">
                            <div class="content_title"><a href="">Không có bài viết</a></div>
                            <div class="content_date">20-06-2013</div>
                            <div class="content_details">
                                <div class="content_images">
                                    <img src="images/img1.png" alt="" />
                                </div>
                                <div class="content_description">Null
                                    <br/><br/>
                                    <div class="btt_img_read"> </div>
                                </div> 
                            </div> 
                        </div>
<?php endif; ?>


                </div><!-- #tab1 -->
                <div id="tab_2" class="tab_content_2">  
                    <p><img  src="images/mortal combat.jpg" alt="" /> <br />
                        <strong>
                            Mortal Kombat returns after a lengthy hiatus and puts players
                            back into the Tournament for 2D fighting with gruesome combat.
                        </strong>
                    </p>

                </div><!-- #tab2 -->
                <div id="tab_3" class="tab_content_2"> 

                    <p><img src="images/halo.jpg" alt="" /> <br />
                        <strong>
                            Halo: Reach is the culmination of the superlative combat, sensational
                            multiplayer, and seamless online integration that are the hallmarks
                            of this superb series.
                        </strong>
                    </p>

                </div><!-- #tab3 -->
                <div id="tab_4" class="tab_content_2"> 

                    <p><img src="images/portal.jpg" alt="" /> <br />
                        <strong>
                            Portal 2 is an action shooter game from Valve Software that draws 
                            from the original formula of innovative gameplay, story, and music,
                            which earned the original Portal more than 70 industry accolades.
                        </strong>
                    </p>

                </div><!-- #tab4 --> 

            </div> <!-- .tab_container --> 

        </div> <!-- #container -->

    </div> <!-- #container -->
    <div class="clear"></div>
</div>


<?php get_footer(); ?>